The Knight's Ghost is Child ballad 265.
A woman goes to bring her son to the shore, to greet her husband. She receives news that he was killed in the city they had gone to. She invites his men to the castle to drink, gets them drunk in the cellar, locks them in, and throws the keys into the sea. Her husband's ghost appears at the foot of her bed with the keys, and tells her to unlock the cellar, because his men could not have fought the harder for him. She asks him when she will die, and he tells her that he has no more power than God has granted him. He tells her instead that she will remarry, to a greater knight than he was, and have nine children: six daughters, and three sons.